/// for MN, MD, VT, and special districts in NY and WV replace sldl with codes (codes correspond to elections_vtd.do data)

// remove leading zeros
replace sldlname= substr(sldlname, 2, .) if substr(sldlname,1,1) == "0"  & fstate==24
replace sldlname= substr(sldlname, 2, .) if substr(sldlname,1,1) == "0"  & fstate==24


replace sldl="1" if (sldlname=="1-A" | sldlname=="1A") & fstate==24
replace sldl="2" if (sldlname=="1-B" | sldlname=="1B") & fstate==24
replace sldl="3" if (sldlname=="1-C" | sldlname=="1C") & fstate==24
replace sldl="4" if (sldlname=="2-A" | sldlname=="2A") & fstate==24
replace sldl="5" if (sldlname=="2-B" | sldlname=="2B") & fstate==24
replace sldl="6" if (sldlname=="2-C" | sldlname=="2C") & fstate==24
replace sldl="7" if (sldlname=="3-A" | sldlname=="3A") & fstate==24
replace sldl="8" if (sldlname=="3-B" | sldlname=="3B") & fstate==24
replace sldl="9" if (sldlname=="4-A"  | sldlname=="4A") & fstate==24
replace sldl="10" if (sldlname=="4-B" | sldlname=="4B") & fstate==24
replace sldl="10" if sldlname=="4" & fstate==24
replace sldl="11" if (sldlname=="5-A" | sldlname=="5A") & fstate==24
replace sldl="12" if (sldlname=="5-B" | sldlname=="5B") & fstate==24
replace sldl="12" if sldlname=="5" & fstate==24
replace sldl="13" if (sldlname=="9-A" | sldlname=="9A") & fstate==24
replace sldl="14" if (sldlname=="9-B" | sldlname=="9B") & fstate==24
replace sldl="15" if (sldlname=="12-A" | sldlname=="12A") & fstate==24
replace sldl="16" if (sldlname=="12-B" | sldlname=="12B")& fstate==24
replace sldl="17" if (sldlname=="23-A" | sldlname=="23A") & fstate==24
replace sldl="18" if (sldlname=="23-B" | sldlname=="23B") & fstate==24
replace sldl="19" if (sldlname=="27-A" | sldlname=="27A") & fstate==24
replace sldl="20" if (sldlname=="27-B" | sldlname=="27B") & fstate==24
replace sldl="21" if (sldlname=="29-A" | sldlname=="29A") & fstate==24
replace sldl="22" if (sldlname=="29-B" | sldlname=="29B") & fstate==24
replace sldl="23" if (sldlname=="29-C" | sldlname=="29C") & fstate==24
replace sldl="24" if (sldlname=="33-A" | sldlname=="33A") & fstate==24
replace sldl="25" if (sldlname=="33-B" | sldlname=="33B") & fstate==24
replace sldl="26" if (sldlname=="34-A" | sldlname=="34A") & fstate==24
replace sldl="27" if (sldlname=="34-B" | sldlname=="34B") & fstate==24
replace sldl="28" if (sldlname=="35-A" | sldlname=="35A") & fstate==24
replace sldl="29" if (sldlname=="35-B" | sldlname=="35B") & fstate==24
replace sldl="30" if (sldlname=="37-A" | sldlname=="37A") & fstate==24
replace sldl="31" if (sldlname=="37-B" | sldlname=="37B") & fstate==24
replace sldl="32" if (sldlname=="38-A" | sldlname=="38A") & fstate==24
replace sldl="33" if (sldlname=="38-B" | sldlname=="38B") & fstate==24
replace sldl="34" if sldlname=="6" & fstate==24
replace sldl="35" if sldlname=="7" & fstate==24
replace sldl="36" if sldlname=="8" & fstate==24
replace sldl="37" if sldlname=="10" & fstate==24
replace sldl="38" if sldlname=="11" & fstate==24
replace sldl="39" if sldlname=="13" & fstate==24
replace sldl="40" if sldlname=="14" & fstate==24
replace sldl="41" if sldlname=="15" & fstate==24
replace sldl="42" if sldlname=="16" & fstate==24
replace sldl="43" if sldlname=="17" & fstate==24
replace sldl="44" if sldlname=="18" & fstate==24
replace sldl="45" if sldlname=="19" & fstate==24
replace sldl="46" if sldlname=="20" & fstate==24
replace sldl="47" if sldlname=="21" & fstate==24
replace sldl="48" if sldlname=="22" & fstate==24
replace sldl="49" if sldlname=="24" & fstate==24
replace sldl="50" if sldlname=="25" & fstate==24
replace sldl="51" if sldlname=="26" & fstate==24
replace sldl="52" if sldlname=="28" & fstate==24
replace sldl="53" if sldlname=="30" & fstate==24
replace sldl="54" if sldlname=="31" & fstate==24
replace sldl="55" if sldlname=="32" & fstate==24
replace sldl="56" if sldlname=="33" & fstate==24
replace sldl="57" if sldlname=="36" & fstate==24
replace sldl="58" if sldlname=="39" & fstate==24
replace sldl="59" if sldlname=="40" & fstate==24
replace sldl="60" if sldlname=="41" & fstate==24
replace sldl="61" if sldlname=="42" & fstate==24
replace sldl="62" if sldlname=="43" & fstate==24
replace sldl="63" if sldlname=="44" & fstate==24
replace sldl="64" if sldlname=="45" & fstate==24
replace sldl="65" if sldlname=="46" & fstate==24
replace sldl="66" if sldlname=="47" & fstate==24
replace sldl="67" if sldlname=="57" & fstate==24
replace sldl="68" if sldlname=="78" & fstate==24
replace sldl="69" if sldlname=="27-C" & fstate==24
replace sldl="70" if sldlname=="30-A" & fstate==24
replace sldl="71" if sldlname=="30-B" & fstate==24
replace sldl="72" if sldlname=="31-A" & fstate==24
replace sldl="73" if sldlname=="31-B" & fstate==24
replace sldl="74" if sldlname=="38-C" & fstate==24
replace sldl="75" if sldlname=="42-A" & fstate==24
replace sldl="76" if sldlname=="42-B" & fstate==24
replace sldl="77" if sldlname=="44-A" & fstate==24
replace sldl="78" if sldlname=="44-B" & fstate==24
replace sldl="79" if sldlname=="47-A" & fstate==24
replace sldl="80" if sldlname=="47-B" & fstate==24
replace sldl="57" if sldlname=="Cecil County 36" & fstate==24
replace sldl="57" if sldlname=="Kent County 36" & fstate==24
replace sldl="57" if sldlname=="Queenannes County 36" & fstate==24

//added for 2010 census redistricting
replace sldl="69" if sldl=="27C" & fstate==24
replace sldl="70" if sldl=="30A" & fstate==24
replace sldl="71" if sldl=="30B" & fstate==24
replace sldl="72" if sldl=="31A" & fstate==24
replace sldl="73" if sldl=="31B" & fstate==24
replace sldl="74" if sldl=="38C" & fstate==24
replace sldl="75" if sldl=="42A" & fstate==24
replace sldl="76" if sldl=="42B" & fstate==24
replace sldl="77" if sldl=="44A" & fstate==24
replace sldl="78" if sldl=="44B" & fstate==24
replace sldl="79" if sldl=="47A" & fstate==24
replace sldl="80" if sldl=="47B" & fstate==24

//added for 2010 census redistricting 
replace sldl="26" if sldl=="26A" & state=="South Dakota"
replace sldl="26.5" if sldl=="26B" & state=="South Dakota"
replace sldl="28" if sldl=="28A" & state=="South Dakota"
replace sldl="28.5" if sldl=="28B" & state=="South Dakota"


replace sldl="1" if (sldl=="01A" | sldl=="1A") & state=="Minnesota"
replace sldl="2" if (sldl=="01B" | sldl=="1B") & state=="Minnesota"
replace sldl="3" if (sldl=="02A" | sldl=="2A") & state=="Minnesota"
replace sldl="4" if (sldl=="02B" | sldl=="2B") & state=="Minnesota"
replace sldl="5" if (sldl=="03A" | sldl=="3A") & state=="Minnesota"
replace sldl="6" if (sldl=="03B" | sldl=="3B") & state=="Minnesota"
replace sldl="7" if (sldl=="04A" | sldl=="4A") & state=="Minnesota"
replace sldl="8" if (sldl=="04B" | sldl=="4B") & state=="Minnesota"
replace sldl="9" if (sldl=="05A" | sldl=="5A") & state=="Minnesota"
replace sldl="10" if (sldl=="05B" | sldl=="5B") & state=="Minnesota"
replace sldl="11" if (sldl=="06A" | sldl=="6A") & state=="Minnesota"
replace sldl="12" if (sldl=="06B" | sldl=="6B") & state=="Minnesota"
replace sldl="13" if (sldl=="07A" | sldl=="7A") & state=="Minnesota"
replace sldl="14" if (sldl=="07B" | sldl=="7B") & state=="Minnesota"
replace sldl="15" if (sldl=="08A" | sldl=="8A") & state=="Minnesota"
replace sldl="16" if (sldl=="08B" | sldl=="8B") & state=="Minnesota"
replace sldl="17" if (sldl=="09A" | sldl=="9A") & state=="Minnesota"
replace sldl="18" if (sldl=="09B" | sldl=="9B") & state=="Minnesota"
replace sldl="19" if sldl=="10A" & state=="Minnesota"
replace sldl="20" if sldl=="10B" & state=="Minnesota"
replace sldl="21" if sldl=="11A" & state=="Minnesota"
replace sldl="22" if sldl=="11B" & state=="Minnesota"
replace sldl="23" if sldl=="12A" & state=="Minnesota"
replace sldl="24" if sldl=="12B" & state=="Minnesota"
replace sldl="25" if sldl=="13A" & state=="Minnesota"
replace sldl="26" if sldl=="13B" & state=="Minnesota"
replace sldl="27" if sldl=="14A" & state=="Minnesota"
replace sldl="28" if sldl=="14B" & state=="Minnesota"
replace sldl="29" if sldl=="15A" & state=="Minnesota"
replace sldl="30" if sldl=="15B" & state=="Minnesota"
replace sldl="31" if sldl=="16A" & state=="Minnesota"
replace sldl="32" if sldl=="16B" & state=="Minnesota"
replace sldl="33" if sldl=="17A" & state=="Minnesota"
replace sldl="34" if sldl=="17B" & state=="Minnesota"
replace sldl="35" if sldl=="18A" & state=="Minnesota"
replace sldl="36" if sldl=="18B" & state=="Minnesota"
replace sldl="37" if sldl=="19A" & state=="Minnesota"
replace sldl="38" if sldl=="19B" & state=="Minnesota"
replace sldl="39" if sldl=="20A" & state=="Minnesota"
replace sldl="40" if sldl=="20B" & state=="Minnesota"
replace sldl="41" if sldl=="21A" & state=="Minnesota"
replace sldl="42" if sldl=="21B" & state=="Minnesota"
replace sldl="43" if sldl=="22A" & state=="Minnesota"
replace sldl="44" if sldl=="22B" & state=="Minnesota"
replace sldl="45" if sldl=="23A" & state=="Minnesota"
replace sldl="46" if sldl=="23B" & state=="Minnesota"
replace sldl="47" if sldl=="24A" & state=="Minnesota"
replace sldl="48" if sldl=="24B" & state=="Minnesota"
replace sldl="49" if sldl=="25A" & state=="Minnesota"
replace sldl="50" if sldl=="25B" & state=="Minnesota"
replace sldl="51" if sldl=="26A" & state=="Minnesota"
replace sldl="52" if sldl=="26B" & state=="Minnesota"
replace sldl="53" if sldl=="27A" & state=="Minnesota"
replace sldl="54" if sldl=="27B" & state=="Minnesota"
replace sldl="55" if sldl=="28A" & state=="Minnesota"
replace sldl="56" if sldl=="28B" & state=="Minnesota"
replace sldl="57" if sldl=="29A" & state=="Minnesota"
replace sldl="58" if sldl=="29B" & state=="Minnesota"
replace sldl="59" if sldl=="30A" & state=="Minnesota"
replace sldl="60" if sldl=="30B" & state=="Minnesota"
replace sldl="61" if sldl=="31A" & state=="Minnesota"
replace sldl="62" if sldl=="31B" & state=="Minnesota"
replace sldl="63" if sldl=="32A" & state=="Minnesota"
replace sldl="64" if sldl=="32B" & state=="Minnesota"
replace sldl="65" if sldl=="33A" & state=="Minnesota"
replace sldl="66" if sldl=="33B" & state=="Minnesota"
replace sldl="67" if sldl=="34A" & state=="Minnesota"
replace sldl="68" if sldl=="34B" & state=="Minnesota"
replace sldl="69" if sldl=="35A" & state=="Minnesota"
replace sldl="70" if sldl=="35B" & state=="Minnesota"
replace sldl="71" if sldl=="36A" & state=="Minnesota"
replace sldl="72" if sldl=="36B" & state=="Minnesota"
replace sldl="73" if sldl=="37A" & state=="Minnesota"
replace sldl="74" if sldl=="37B" & state=="Minnesota"
replace sldl="75" if sldl=="38A" & state=="Minnesota"
replace sldl="76" if sldl=="38B" & state=="Minnesota"
replace sldl="77" if sldl=="39A" & state=="Minnesota"
replace sldl="78" if sldl=="39B" & state=="Minnesota"
replace sldl="79" if sldl=="40A" & state=="Minnesota"
replace sldl="80" if sldl=="40B" & state=="Minnesota"
replace sldl="81" if sldl=="41A" & state=="Minnesota"
replace sldl="82" if sldl=="41B" & state=="Minnesota"
replace sldl="83" if sldl=="42A" & state=="Minnesota"
replace sldl="84" if sldl=="42B" & state=="Minnesota"
replace sldl="85" if sldl=="43A" & state=="Minnesota"
replace sldl="86" if sldl=="43B" & state=="Minnesota"
replace sldl="87" if sldl=="44A" & state=="Minnesota"
replace sldl="88" if sldl=="44B" & state=="Minnesota"
replace sldl="89" if sldl=="45A" & state=="Minnesota"
replace sldl="90" if sldl=="45B" & state=="Minnesota"
replace sldl="91" if sldl=="46A" & state=="Minnesota"
replace sldl="92" if sldl=="46B" & state=="Minnesota"
replace sldl="93" if sldl=="47A" & state=="Minnesota"
replace sldl="94" if sldl=="47B" & state=="Minnesota"
replace sldl="95" if sldl=="48A" & state=="Minnesota"
replace sldl="96" if sldl=="48B" & state=="Minnesota"
replace sldl="97" if sldl=="49A" & state=="Minnesota"
replace sldl="98" if sldl=="49B" & state=="Minnesota"
replace sldl="99" if sldl=="50A" & state=="Minnesota"
replace sldl="100" if sldl=="50B" & state=="Minnesota"
replace sldl="101" if sldl=="51A" & state=="Minnesota"
replace sldl="102" if sldl=="51B" & state=="Minnesota"
replace sldl="103" if sldl=="52A" & state=="Minnesota"
replace sldl="104" if sldl=="52B" & state=="Minnesota"
replace sldl="105" if sldl=="53A" & state=="Minnesota"
replace sldl="106" if sldl=="53B" & state=="Minnesota"
replace sldl="107" if sldl=="54A" & state=="Minnesota"
replace sldl="108" if sldl=="54B" & state=="Minnesota"
replace sldl="109" if sldl=="55A" & state=="Minnesota"
replace sldl="110" if sldl=="55B" & state=="Minnesota"
replace sldl="111" if sldl=="56A" & state=="Minnesota"
replace sldl="112" if sldl=="56B" & state=="Minnesota"
replace sldl="113" if sldl=="57A" & state=="Minnesota"
replace sldl="114" if sldl=="57B" & state=="Minnesota"
replace sldl="115" if sldl=="58A" & state=="Minnesota"
replace sldl="116" if sldl=="58B" & state=="Minnesota"
replace sldl="117" if sldl=="59A" & state=="Minnesota"
replace sldl="118" if sldl=="59B" & state=="Minnesota"
replace sldl="119" if sldl=="60A" & state=="Minnesota"
replace sldl="120" if sldl=="60B" & state=="Minnesota"
replace sldl="121" if sldl=="61A" & state=="Minnesota"
replace sldl="122" if sldl=="61B" & state=="Minnesota"
replace sldl="123" if sldl=="62A" & state=="Minnesota"
replace sldl="124" if sldl=="62B" & state=="Minnesota"
replace sldl="125" if sldl=="63A" & state=="Minnesota"
replace sldl="126" if sldl=="63B" & state=="Minnesota"
replace sldl="127" if sldl=="64A" & state=="Minnesota"
replace sldl="128" if sldl=="64B" & state=="Minnesota"
replace sldl="129" if sldl=="65A" & state=="Minnesota"
replace sldl="130" if sldl=="65B" & state=="Minnesota"
replace sldl="131" if sldl=="66A" & state=="Minnesota"
replace sldl="132" if sldl=="66B" & state=="Minnesota"
replace sldl="133" if sldl=="67A" & state=="Minnesota"
replace sldl="134" if sldl=="67B" & state=="Minnesota"

replace sldl="1.5" if sldl=="R-2" & state=="New York"

replace sldl="1" if sldl=="A-1" & state=="Vermont" & year==2017
replace sldl="2" if sldl=="A-2" & state=="Vermont" & year==2017
replace sldl="3" if sldl=="A-3" & state=="Vermont" & year==2017
replace sldl="4" if sldl=="A-4" & state=="Vermont" & year==2017
replace sldl="5" if sldl=="A-5" & state=="Vermont" & year==2017
replace sldl="6" if sldl=="A-R" & state=="Vermont" & year==2017
replace sldl="7" if sldl=="B-1" & state=="Vermont" & year==2017
replace sldl="8" if sldl=="B-3" & state=="Vermont" & year==2017
replace sldl="9" if sldl=="B-4" & state=="Vermont" & year==2017
replace sldl="10" if sldl=="B-R" & state=="Vermont" & year==2017
replace sldl="11" if sldl=="B21" & state=="Vermont" & year==2017
replace sldl="12" if sldl=="B22" & state=="Vermont" & year==2017
replace sldl="13" if sldl=="C-1" & state=="Vermont" & year==2017
replace sldl="14" if sldl=="C-2" & state=="Vermont" & year==2017
replace sldl="15" if sldl=="C-3" & state=="Vermont" & year==2017
replace sldl="16" if sldl=="C10" & state=="Vermont" & year==2017
replace sldl="17" if sldl=="C41" & state=="Vermont" & year==2017
replace sldl="18" if sldl=="C42" & state=="Vermont" & year==2017
replace sldl="19" if sldl=="C51" & state=="Vermont" & year==2017
replace sldl="20" if sldl=="C52" & state=="Vermont" & year==2017
replace sldl="21" if sldl=="C61" & state=="Vermont" & year==2017
replace sldl="22" if sldl=="C62" & state=="Vermont" & year==2017
replace sldl="23" if sldl=="C63" & state=="Vermont" & year==2017
replace sldl="24" if sldl=="C64" & state=="Vermont" & year==2017
replace sldl="25" if sldl=="C65" & state=="Vermont" & year==2017
replace sldl="26" if sldl=="C66" & state=="Vermont" & year==2017
replace sldl="27" if sldl=="C67" & state=="Vermont" & year==2017
replace sldl="28" if sldl=="C71" & state=="Vermont" & year==2017
replace sldl="29" if sldl=="C72" & state=="Vermont" & year==2017
replace sldl="30" if sldl=="C73" & state=="Vermont" & year==2017
replace sldl="31" if sldl=="C74" & state=="Vermont" & year==2017
replace sldl="32" if sldl=="C81" & state=="Vermont" & year==2017
replace sldl="33" if sldl=="C82" & state=="Vermont" & year==2017
replace sldl="34" if sldl=="C83" & state=="Vermont" & year==2017
replace sldl="35" if sldl=="C91" & state=="Vermont" & year==2017
replace sldl="36" if sldl=="C92" & state=="Vermont" & year==2017
replace sldl="37" if sldl=="CA1" & state=="Vermont" & year==2017
replace sldl="38" if sldl=="CA2" & state=="Vermont" & year==2017
replace sldl="39" if sldl=="CA3" & state=="Vermont" & year==2017
replace sldl="40" if sldl=="CA4" & state=="Vermont" & year==2017
replace sldl="41" if sldl=="CAW" & state=="Vermont" & year==2017
replace sldl="42" if sldl=="E-C" & state=="Vermont" & year==2017
replace sldl="43" if sldl=="ECO" & state=="Vermont" & year==2017
replace sldl="44" if sldl=="F-1" & state=="Vermont" & year==2017
replace sldl="45" if sldl=="F-2" & state=="Vermont" & year==2017
replace sldl="46" if sldl=="F-4" & state=="Vermont" & year==2017
replace sldl="47" if sldl=="F-5" & state=="Vermont" & year==2017
replace sldl="48" if sldl=="F-6" & state=="Vermont" & year==2017
replace sldl="49" if sldl=="F-7" & state=="Vermont" & year==2017
replace sldl="50" if sldl=="F31" & state=="Vermont" & year==2017
replace sldl="51" if sldl=="F32" & state=="Vermont" & year==2017
replace sldl="52" if sldl=="GIC" & state=="Vermont" & year==2017
replace sldl="53" if sldl=="LM1" & state=="Vermont" & year==2017
replace sldl="54" if sldl=="LM2" & state=="Vermont" & year==2017
replace sldl="55" if sldl=="LM3" & state=="Vermont" & year==2017
replace sldl="56" if sldl=="LMW" & state=="Vermont" & year==2017
replace sldl="57" if sldl=="O-1" & state=="Vermont" & year==2017
replace sldl="58" if sldl=="O-2" & state=="Vermont" & year==2017
replace sldl="59" if sldl=="O-C" & state=="Vermont" & year==2017
replace sldl="60" if sldl=="O-L" & state=="Vermont" & year==2017
replace sldl="61" if sldl=="OLC" & state=="Vermont" & year==2017
replace sldl="62" if sldl=="OR1" & state=="Vermont" & year==2017
replace sldl="63" if sldl=="OR2" & state=="Vermont" & year==2017
replace sldl="64" if sldl=="OWA" & state=="Vermont" & year==2017
replace sldl="65" if sldl=="R-1" & state=="Vermont" & year==2017
replace sldl="66" if sldl=="R-2" & state=="Vermont" & year==2017
replace sldl="67" if sldl=="R-3" & state=="Vermont" & year==2017
replace sldl="68" if sldl=="R-4" & state=="Vermont" & year==2017
replace sldl="69" if sldl=="R-6" & state=="Vermont" & year==2017
replace sldl="70" if sldl=="R-B" & state=="Vermont" & year==2017
replace sldl="71" if sldl=="R-W" & state=="Vermont" & year==2017
replace sldl="72" if sldl=="R51" & state=="Vermont" & year==2017
replace sldl="73" if sldl=="R52" & state=="Vermont" & year==2017
replace sldl="74" if sldl=="R53" & state=="Vermont" & year==2017
replace sldl="75" if sldl=="R54" & state=="Vermont" & year==2017
replace sldl="76" if sldl=="RW2" & state=="Vermont" & year==2017
replace sldl="77" if sldl=="W-1" & state=="Vermont" & year==2017
replace sldl="78" if sldl=="W-3" & state=="Vermont" & year==2017
replace sldl="79" if sldl=="W-4" & state=="Vermont" & year==2017
replace sldl="80" if sldl=="W-5" & state=="Vermont" & year==2017
replace sldl="81" if sldl=="W-6" & state=="Vermont" & year==2017
replace sldl="82" if sldl=="W21" & state=="Vermont" & year==2017
replace sldl="83" if sldl=="W22" & state=="Vermont" & year==2017
replace sldl="84" if sldl=="W23" & state=="Vermont" & year==2017
replace sldl="85" if sldl=="WA1" & state=="Vermont" & year==2017
replace sldl="86" if sldl=="WA2" & state=="Vermont" & year==2017
replace sldl="87" if sldl=="WA3" & state=="Vermont" & year==2017
replace sldl="88" if sldl=="WA4" & state=="Vermont" & year==2017
replace sldl="89" if sldl=="WA5" & state=="Vermont" & year==2017
replace sldl="90" if sldl=="WA6" & state=="Vermont" & year==2017
replace sldl="91" if sldl=="WA7" & state=="Vermont" & year==2017
replace sldl="92" if sldl=="WAC" & state=="Vermont" & year==2017
replace sldl="93" if sldl=="WBW" & state=="Vermont" & year==2017
replace sldl="94" if sldl=="WIB" & state=="Vermont" & year==2017
replace sldl="95" if sldl=="Y-1" & state=="Vermont" & year==2017
replace sldl="96" if sldl=="Y-2" & state=="Vermont" & year==2017
replace sldl="97" if sldl=="Y-5" & state=="Vermont" & year==2017
replace sldl="98" if sldl=="Y-R" & state=="Vermont" & year==2017
replace sldl="99" if sldl=="Y31" & state=="Vermont" & year==2017
replace sldl="100" if sldl=="Y32" & state=="Vermont" & year==2017
replace sldl="101" if sldl=="Y41" & state=="Vermont" & year==2017
replace sldl="102" if sldl=="Y42" & state=="Vermont" & year==2017
replace sldl="103" if sldl=="YO1" & state=="Vermont" & year==2017
replace sldl="104" if sldl=="YO2" & state=="Vermont" & year==2017
replace sldl="1" if sldl=="310" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="2" if sldl=="A-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="3" if sldl=="A-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="4" if sldl=="A-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="5" if sldl=="A-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="6" if sldl=="A-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="7" if sldl=="AR1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="8" if sldl=="B-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="9" if sldl=="B-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="10" if sldl=="B-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="11" if sldl=="B-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="12" if sldl=="B21" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="13" if sldl=="B22" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="14" if sldl=="BR1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="15" if sldl=="C-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="16" if sldl=="C-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="17" if sldl=="C-8" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="18" if sldl=="C-9" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="19" if sldl=="C11" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="20" if sldl=="C12" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="21" if sldl=="C31" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="22" if sldl=="C32" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="23" if sldl=="C33" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="24" if sldl=="C34" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="25" if sldl=="C35" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="26" if sldl=="C36" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="27" if sldl=="C37" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="28" if sldl=="C38" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="29" if sldl=="C39" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="30" if sldl=="C51" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="31" if sldl=="C52" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="32" if sldl=="C61" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="33" if sldl=="C62" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="34" if sldl=="C63" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="35" if sldl=="C71" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="36" if sldl=="C72" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="37" if sldl=="CA1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="38" if sldl=="CA2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="39" if sldl=="CA3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="40" if sldl=="CA4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="41" if sldl=="CAW" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="42" if sldl=="EC1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="43" if sldl=="EC2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="44" if sldl=="F-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="45" if sldl=="F-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="46" if sldl=="F-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="47" if sldl=="F-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="48" if sldl=="F-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="49" if sldl=="F-6" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="50" if sldl=="GC1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="51" if sldl=="L-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="52" if sldl=="L-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="53" if sldl=="L-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="54" if sldl=="L-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="55" if sldl=="LW1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="56" if sldl=="OA1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="57" if sldl=="OG1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="58" if sldl=="OG2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="59" if sldl=="OGC" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="60" if sldl=="OL1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="61" if sldl=="OL2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="62" if sldl=="OLC" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="63" if sldl=="OLF" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="64" if sldl=="R-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="65" if sldl=="R-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="66" if sldl=="R-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="67" if sldl=="R-6" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="68" if sldl=="R-7" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="69" if sldl=="R-8" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="70" if sldl=="R11" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="71" if sldl=="R12" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="72" if sldl=="R51" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="73" if sldl=="R52" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="74" if sldl=="R53" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="75" if sldl=="R54" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="76" if sldl=="RY1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="77" if sldl=="W-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="78" if sldl=="W-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="79" if sldl=="W-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="80" if sldl=="W-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="81" if sldl=="W-6" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="82" if sldl=="W-7" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="83" if sldl=="W31" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="84" if sldl=="W32" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="85" if sldl=="W33" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="86" if sldl=="WC1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="87" if sldl=="X-1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="88" if sldl=="X-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="89" if sldl=="X-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="90" if sldl=="X-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="91" if sldl=="X-6" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="92" if sldl=="X31" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="93" if sldl=="X32" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="94" if sldl=="X33" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="95" if sldl=="XB1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="96" if sldl=="XBY" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="97" if sldl=="Y-2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="98" if sldl=="Y-3" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="99" if sldl=="Y-4" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="100" if sldl=="Y-5" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="101" if sldl=="Y11" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="102" if sldl=="Y12" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="103" if sldl=="Y61" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="104" if sldl=="Y62" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="105" if sldl=="YO1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="106" if sldl=="YO2" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="107" if sldl=="YR1" & state=="Vermont" & (year==2012 | year==2007)
replace sldl="108" if sldl=="YR2" & state=="Vermont" & (year==2012 | year==2007)
